/*
PearReview - The peer review assistant.
Copyright (C) 2009  Dimitrij Pankratz, Anton Musichin
http://www.pearreview.com, info@pearreview.com

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

package com.pearreview.application;

import java.awt.Component;
import java.io.File;
import java.io.Serializable;

import javax.swing.Icon;
import javax.swing.JToolBar;
import javax.swing.event.ChangeListener;

public interface PluginAdapter extends Serializable {
	/**
	 * Closes the plugin view
	 */
	public void close();
	
	/**
	 * Creates a new start tab
	 * @param select if <code>true</code> the the new start tab, 
	 * will be selected.
	 */
	public void newStartTab(boolean select);
	
	/**
	 * Navigates current tab to start tab
	 */
	public void navigateToStartTab();
	
	/**
	 * Creates a new plugin tab
	 * @param plugin plugin to open in new tab
	 * @param select if <code>true</code> the the new plugin tab, 
	 * will be selected.
	 */
	public void newPluginTab(Plugin plugin, boolean select);
	
	/**
	 * Checks if application is in full screen mode
	 * @return
	 */
	public boolean isFullScreen();
	
	/**
	 * Set the full screen mode of application
	 * @param enabled
	 */
	public void setFullScreen(boolean enabled);
	
	/**
	 * Sets the new title of plugin
	 * @param tabTitle this title will be showed in tab
	 * @param frameTitle this title will be showed in window
	 */
	public void setTitle(String tabTitle, String frameTitle);
	
	/**
	 * Sets file which is currently open
	 * @param file which is open
	 */
	public void setFile(File f);
	
	/**
	 * Sets tab icon
	 * @param icon to set
	 */
	public void setTabIcon(Icon icon);
	
	/**
	 * Sets toolbar
	 */
	public void setToolBar(JToolBar toolBar);
	
	/**
	 * Sets component to show
	 * This component will be showed in the main container in application.
	 */
	public void setComponent(Component comp);
	
	/**
	 * Return menu bar adapter, who contains default menu items of application
	 * @return menu bar adapter
	 */
	public MenuBarAdapter getMenuBarAdapter();
	
	/**
	 * Gets workspace of plugin.<br>
	 * <b>NOTE</b> The workspace is a directory.
	 * @return workspace of plugin
	 */
	public File getWorkspace();
	
	/**
	 * Returns spring glass pane of application
	 */
	public SpringGlassPane getSpringGlassPane();
	
	/**
	 * Adds a full screen change listener
	 * @param cl listener to add
	 */
	public void addFullScreenListener(ChangeListener cl);
	
	/**
	 * Removes a full screen change listener
	 * @param cl listener to remove
	 */
	public void removeFullScreenListener(ChangeListener cl);
	
	/**
	 * Returns file history
	 * @return file history
	 */
	public FileHistory getFileHistory();
}
